﻿// ----------------------------------------------
// JSON,DOM,ON(事件)
// 江怀玉
// -----------------------------------------------
//var Json2Object, Object2Json;
require(["dojo/json", "dojo/dom", "dojo/on", "dojo/parser"],
function (JSON, dom, on) {
    Json2Object = function (jsonStr) {
        //return JSON.parese(jsonStr);
    }

    Object2Json = function (instance) {
        return JSON.stringify(instance);
    }
    /*
    on(dom.byId("convert"), "click", function () {
    var origin = '{"hello": "world"}';

    var obj = JSON.parse(origin);

    obj.hello = "Dojo";
    obj.something = "New";

    var output = JSON.stringify(obj);

    dom.byId("output").innerHTML = output;
    });
   
    */
    Object2Form = function (instance) {
    }
});
//setTimeout(function () {
//    obj = { name: "jianghuaiyu", age: "33" };
//    //var str = Object2Json(obj);
//    //var _obj = Json2Object(str);
//    //alert(_obj.name +":"+ _obj.age);
//}, 5000);